package com.atmilan.quartz.model.dto.carotta;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 喜洋洋商品映射对象
 * @Description:
 * @author daigb
 * @date 2021-06-02
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CarottaProductResDTO {

    /**
     * 页面id
     */
    private String pageInfo;

    /**
     * 商品数据
     */
    @JsonProperty(value = "products")
    private List<CarottaResp> products;

    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class CarottaResp {
        /**
         * 商品id
         */
        @JsonProperty(value = "id")
        private Long id;

        /**
         * 商品名称
         */
        @JsonProperty(value = "title")
        private String title;

        /**
         * 商品描述
         */
        @JsonProperty(value = "body_html")
        private String bodyHtml;

        /**
         * 供应商
         */
        @JsonProperty(value = "vendor")
        private String vendor;

        /**
         * 产品类型
         */
        @JsonProperty(value = "product_type")
        private String productType;

        /**
         * 创建时间
         */
        @JsonProperty(value = "created_at")
        private Date createdAt;

        /**
         * handle
         */
        @JsonProperty(value = "handle")
        private String handle;

        /**
         * 更新时间
         */
        @JsonProperty(value = "updated_at")
        private Date updatedAt;

        /**
         * 发布时间
         */
        @JsonProperty(value = "published_at")
        private Date publishedAt;

        /**
         * 模板后缀
         */
        @JsonProperty(value = "template_suffix")
        private String templateSuffix;

        /**
         * 状态
         */
        @JsonProperty(value = "status")
        private String status;

        /**
         * 发布范围
         */
        @JsonProperty(value = "published_scope")
        private String publishedScope;

        /**
         * 标签
         */
        @JsonProperty(value = "tags")
        private String tags;

        /**
         * admin_graphql_api_id
         */
        @JsonProperty(value = "admin_graphql_api_id")
        private String adminGraphqlApiId;

        /**
         * variants
         */
        @JsonProperty(value = "variants")
        private List<Variant> variants;

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class Variant {

            /**
             * 商品id
             */
            @JsonProperty(value = "product_id")
            private Long productId;

            /**
             * variant id
             */
            @JsonProperty(value = "id")
            private Long Id;

            /**
             * title(suk)
             */
            @JsonProperty(value = "title")
            private String title;

            /**
             * price
             */
            @JsonProperty(value = "price")
            private BigDecimal price;

            /**
             * sku
             */
            @JsonProperty(value = "sku")
            private String sku;

            /**
             * position
             */
            @JsonProperty(value = "position")
            private Integer position;

            /**
             * 库存策略
             */
            @JsonProperty(value = "inventory_policy")
            private String inventoryPolicy;

            /**
             * compare_at_price
             */
            @JsonProperty(value = "compare_at_price")
            private BigDecimal compareAtPrice;

            /**
             * 物流服务
             */
            @JsonProperty(value = "fulfillment_service")
            private String fulfillmentService;

            /**
             * 存货管理
             */
            @JsonProperty(value = "inventory_management")
            private String inventoryManagement;

            /**
             * option1
             */
            @JsonProperty(value = "option1")
            private String option1;

            /**
             * option2
             */
            @JsonProperty(value = "option2")
            private String option2;

            /**
             * option3
             */
            @JsonProperty(value = "option3")
            private String option3;

            /**
             * created_at
             */
            @JsonProperty(value = "created_at")
            private Date createdAt;

            /**
             * updated_at
             */
            @JsonProperty(value = "updated_at")
            private Date updatedAt;

            /**
             * taxable
             */
            @JsonProperty(value = "taxable")
            private Boolean taxable;

            /**
             * barcode
             */
            @JsonProperty(value = "barcode")
            private String barcode;

            /**
             * grams
             */
            @JsonProperty(value = "grams")
            private Integer grams;

            /**
             * image_id
             */
            @JsonProperty(value = "image_id")
            private Long imageId;

            /**
             * weight
             */
            @JsonProperty(value = "weight")
            private String weight;

            /**
             * weight_unit
             */
            @JsonProperty(value = "weight_unit")
            private String weightUnit;

            /**
             * inventory_item_id
             */
            @JsonProperty(value = "inventory_item_id")
            private Long inventoryItemId;

            /**
             * inventory_quantity
             */
            @JsonProperty(value = "inventory_quantity")
            private Integer inventoryQuantity;

            /**
             * old_inventory_quantity
             */
            @JsonProperty(value = "old_inventory_quantity")
            private Integer oldInventoryQuantity;

            /**
             * requires_shipping
             */
            @JsonProperty(value = "requires_shipping")
            private Boolean requiresShipping;

            /**
             * admin_graphql_api_id
             */
            @JsonProperty(value = "admin_graphql_api_id")
            private String adminGraphqlApiId;

        }

        /**
         * options
         */
        @JsonProperty(value = "options")
        private List<Option> options;

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class Option {
            /**
             * product_id
             */
            @JsonProperty(value = "product_id")
            private Long productId;

            /**
             * id
             */
            @JsonProperty(value = "id")
            private Long id;

            /**
             * name
             */
            @JsonProperty(value = "name")
            private String name;

            /**
             * position
             */
            @JsonProperty(value = "position")
            private Integer position;

            /**
             * values
             */
            @JsonProperty(value = "values")
            private List<String> values;
        }

        /**
         * images
         */
        @JsonProperty(value = "images")
        private List<Image> images;

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class Image {
            /**
             * id
             */
            @JsonProperty(value = "id")
            private Long id;

            /**
             * product_id
             */
            @JsonProperty(value = "product_id")
            private Long productId;

            /**
             * position
             */
            @JsonProperty(value = "position")
            private Integer position;

            /**
             * created_at
             */
            @JsonProperty(value = "created_at")
            private String createdAt;

            /**
             * updated_at
             */
            @JsonProperty(value = "updated_at")
            private String updatedAt;

            /**
             * alt
             */
            @JsonProperty(value = "alt")
            private String alt;

            /**
             * width
             */
            @JsonProperty(value = "width")
            private Integer width;

            /**
             * height
             */
            @JsonProperty(value = "height")
            private Integer height;

            /**
             * src
             */
            @JsonProperty(value = "src")
            private String src;

            /**
             * variant_ids
             */
            @JsonProperty(value = "variant_ids")
            private List<Long> variantIds;

            /**
             * admin_graphql_api_id
             */
            @JsonProperty(value = "admin_graphql_api_id")
            private String adminGraphqlApiId;
        }

        /**
         * image
         */
        @JsonProperty(value = "image")
        private Image image;

    }

}
